package com.est.dase.widget;

import com.est.dase.R;
import android.content.Context;
/**
*
* @author Fernando Geraldes, Jaime Santos, Jorge Silva
*
*/
public class Status {

	int status = 0;
	int options = 4;
	Context context = null;
	String outro = null;
	
	private static Status instance = null;
	
	public static Status getInstance(Context context) {
	      if(instance == null) {
	         instance = new Status(context);
	      }
	      return instance;
		}
	
	public Status(Context context){
		this.context = context;
	}
	
	public String getNextStatus(){
		status++;
		if(status == (options+1))
			status = 1;
		return getStatusName(status);
	}
	
	public String getPreviousStatus(){
		status--;
		if(status == 0)
			status = options;
		return getStatusName(status);
	}
	
	public String getCurrentStatus(){
		return getStatusName(status);
	}
	
	public String getStatusName(int number){
		String name = null;
		
		switch(number){
			case 1:
				name = context.getString(R.string.status_available);
				break;
			case 2: 
				name = context.getString(R.string.status_driving);
				break;
			case 3: 
				name = context.getString(R.string.status_working);
				break;	
			case 4: 
				name = context.getString(R.string.status_other);
				break;	
			default:
				name = context.getString(R.string.status_notdefined);
		}
		return name;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getOutro() {
		return outro;
	}

	public void setOutro(String outro) {
		this.outro = outro;
	}
	
	
}
